<template>
  <page-main>
    
    <div class="list">
      <v-chart :option="data1" autoresize style="height:400px"></v-chart>
    </div>
  </page-main>
</template>
<script>
export default {
  data() {
    return {
      data1: {
        title: {
          text: 'Referer of a Website',
          subtext: 'Fake Data',
          left: 'center'
        },
        legend: {
          // orient: 'vertical',
          left: 'left'
        },
        series: [
          {
            name: 'Access From',
            type: 'pie',
            radius: '50%',
            data: [
              { value: 1048, name: 'Search Engine' },
              { value: 735, name: 'Direct' },
              { value: 580, name: 'Email' },
              { value: 484, name: 'Union Ads' },
              { value: 300, name: 'Video Ads' }
            ],
          }
        ]
      }
    }
  },
  created() {
    this.getOne();
    this.getAll();
  },
  methods: {
    getOne(){
      let params = {
        start_date: '2023-01-01',
        end_date: '2023-05-17',
        group_by_month: false,
      };
      this.$request('get', '/chaqi/city_days_count', params, (data,msg) => {

      },msg => {

      },{}, 'all')
    },
    getAll(){
      let params = {
        start_date: '2023-01-01',
        end_date: '2023-05-17',
        group_by_month: false,
        station_name : 'All',
      };
      this.$request('get', '/chaqi/days_count', params, (data,msg) => {

      }, msg => {

      },{}, 'all')
    }
  }
}
</script>